<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
    <title>Document</title>
</head>
<body>
    <form action="">
        <input type="text" id="email" name="email" placeholder="请输入邮箱">
        <br>
        <input type="text" id="psw" name="psw" placeholder="请输入密码">
        <br>
        <button>登录</button>
    </form>
    <script>
       $('form').on('submit',function(e){
            e.preventDefault()
            $.post('/login',$('form').serialize(),function(data){
                if(data.code =='200'){
                    alert(data.message)
                    location.href='zhuye.html'
                }
                else{
                    alert(data.message)
                }
            })
        })
    </script>
</body>
</html>